package com.pickme.food.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pickme.food.pojo.Orders;
import com.pickme.food.pojo.Stats;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OrdersMapper extends BaseMapper<Orders> {

    @Select("select count(*) orders,sum(ro.amount) amounts from reggie.orders ro where date(ro.checkout_time) = #{day};")
    Stats getDayStats(String day);

}